/**
 * 
 */
package com.hanhai.zrb.api.biz.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.hanhai.zrb.model.common.CommonCounter;
import com.hanhai.zrb.model.common.CommonCounterKey;
import com.hanhai.zrb.model.common.CommonCounterKey.MainKeyType;

/**
 * @author leiruiqi
 *
 */
public interface CommonCounterService {

	boolean create(CommonCounter record);
	
	boolean addOne(CommonCounterKey commonCounterKey);
	
	boolean addOneByLock(CommonCounterKey commonCounterKey);
	
	boolean update(CommonCounter record);
	
	boolean addOneForMaxValue(CommonCounterKey commonCounterKey,Long maxValue);
	
	boolean addOneForMaxValueByLock(CommonCounterKey commonCounterKey,Long maxValue);
	
	boolean subOne(CommonCounterKey commonCounterKey);
	
	boolean subOneByLock(CommonCounterKey commonCounterKey);
	
	CommonCounter selectForLock(CommonCounterKey commonCounterKey);
	
	boolean exist(CommonCounterKey commonCounterKey);
	
	Long getCurrentCountByKey(CommonCounterKey commonCounterKey);
	
	List<CommonCounter> getListByKeyList(List<CommonCounterKey> commonCounterKeyList);
	
	Map<Long,Long> getListByMainKey(String mainKey);
	
	List<CommonCounter> getListBySecondekeyList( CommonCounterKey commonCounterKey);
	
	public Map<String,CommonCounter> listMapBySecondaryKeyList(String mainKeyType,List<String> secondaryKeyList) ;
	
	
	public Map<String,Long> listCountMapBySecondaryKeyList(String mainKeyType,List<String> secondaryKeyList);

	
}
